import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/mes-admin//rule/distinguish/page',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

export const getDetail = (id) => {
  return request({
    url: '/api/mes-admin//rule/distinguish/detail',
    method: 'get',
    params: {
      id
    }
  });
};

export const getDetailTableData = (id) => {
  return request({
    url: 'api/mes-admin//rule/extract/list',
    method: 'get',
    params: {
      ruleDistinguishId: id
    }
  });
};

export const remove = (ids) => {
  return request({
    url: '/api/mes-admin/rule/distinguish/remove',
    method: 'delete',
    params: {
      ids
    }
  });
};

export const add = (row) => {
  return request({
    url: '/api/mes-admin/rule/distinguish/submit',
    method: 'post',
    data: row
  });
};

export const update = (row) => {
  return request({
    url: '/api/mes-admin/rule/submit',
    method: 'post',
    data: row
  });
};

export const getRuleDetail = (ruleDistinguishId) => {
  return request({
    url: '/api/mes-admin/rule/extract/list',
    method: 'get',
    params: {
      ruleDistinguishId
    }
  });
};

export const addRuleDetail = (row) => {
  return request({
    url: '/api/mes-admin/rule/extract/submit',
    method: 'post',
    data: row
  });
};

export const removeRuleDetail = (ids) => {
  return request({
    url: '/api/mes-admin/rule/extract/remove',
    method: 'delete',
    params: {
      ids
    }
  });
};
